import request from '@/config/axios'

// 企业股东信息 VO

export interface CompanyShareholdersVO {
  id: number
  companyId: number
  shareholderName: string
  shareholdingRatio: number
  businessType: string // 业务类型：registered-company-注册企业，accounting-companies-记账企业
  creatorName: string
  updaterName: string
  createTime: Date
  updateTime: Date
  creator: string
  updater: string
  deleted: boolean
}

export interface CompanyShareholdersSaveReqVO {
  id?: number
  companyId: number
  shareholderName: string
  shareholdingRatio: number
  businessType: string // 业务类型：registered-company-注册企业，accounting-companies-记账企业
}

export interface CompanyShareholdersPageReqVO extends PageParam {
  companyId?: number
  shareholderName?: string
  businessType?: string
}

// 企业股东信息 API
export const CompanyShareholdersApi = {
  // 查询企业股东信息分页
  getCompanyShareholdersPage: async (params: any) => {
    return await request.get({ url: `/oa/company-shareholders/page`, params })
  },

  // 查询企业股东信息详情
  getCompanyShareholders: async (id: number) => {
    return await request.get({ url: `/oa/company-shareholders/get?id=` + id })
  },

  // 新增企业股东信息
  createCompanyShareholders: async (data: CompanyShareholdersVO) => {
    return await request.post({ url: `/oa/company-shareholders/create`, data })
  },

  // 修改企业股东信息
  updateCompanyShareholders: async (data: CompanyShareholdersVO) => {
    return await request.put({ url: `/oa/company-shareholders/update`, data })
  },

  // 删除企业股东信息
  deleteCompanyShareholders: async (id: number) => {
    return await request.delete({ url: `/oa/company-shareholders/delete?id=` + id })
  },

  // 导出企业股东信息 Excel
  exportCompanyShareholders: async (params) => {
    return await request.download({ url: `/oa/company-shareholders/export-excel`, params })
  },

  // 查询企业股东信息列表
  getCompanyShareholdersList: async (params: CompanyShareholdersPageReqVO) => {
    return request.get({ url: '/oa/company-shareholders/list', params })
  },

  
}
